import request from "@/utils/request";

// 立即考试（交卷）-学生
export function examAnswer(data = {}) {
    return request({
        url: "/examination/exam/answer",
        method: "post",
        data,
    });
}


// 查询试卷管理列表
export function listPaper(params) {
    return request({
        url: '/examination/paper/list',
        method: 'get',
        params
    })
}


// 删除试卷管理
export function delPaper(paperId) {
    return request({
        url: '/examination/paper/delete/' + paperId,
        method: 'delete'
    })
}

// 发布试卷
export function publishPaper(data) {
    return request({
        url: '/examination/paper/push',
        method: 'put',
        data: data
    })
}
// 试卷预览与考试试卷详情通用--选项中所有答案都设置为错误
export function showPaperList(id) {
    return request({
        url: '/examination/paper/show/' + id,
        method: 'get'
    })
}

// 试题信息管理列表
export function listQuestion(query) {
    return request({
        url: '/examination/question/list',
        method: 'get',
        params: query
    })
}

// 查询试卷管理详细
export function getPaper(paperId) {
    return request({
        url: '/examination/paper/getInfo/' + paperId,
        method: 'get'
    })
}

// 新增试卷管理
export function addPaper(data) {
    return request({
        url: '/examination/paper',
        method: 'post',
        data: data
    })
}

// 修改试卷管理
export function updatePaper(data) {
    return request({
        url: '/examination/paper',
        method: 'put',
        data: data
    })
}

// 查询试卷详情-试题列表（包含全部试题-标记已选）
export function paperIdByQuestionList(params) {
    return request({
        url: '/examination/question/editPaperlist',
        method: 'get',
        params
    })
}

// 获取当前登录人昵称（新增试卷获取出题人）
export function getPaperAuthorName(params) {
    return request({
        url: '/examination/paper/getPaperAuthorName',
        method: 'get',
        params
    })
}
